package date.calendar;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class GetDayByWeek2 {

    public static void main(String[] args) {
        new GetDayByWeek2().getWeekData(6);
    }

    public String getWeekData(int week) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        int day = week * 7 - 11;
        Calendar cld = Calendar.getInstance();
        cld.set(Calendar.MONDAY, 0);
        cld.set(Calendar.DATE, 1);
        cld.add(Calendar.DATE, day);
        String s = sdf.format(cld.getTime());
        cld.add(Calendar.DATE, 6);
        String data = s + "到" + sdf.format(cld.getTime());
        // LOG.log(Level.INFO, "第{0}周的时间段为：{1}", new Object[]{week, data});
        System.out.println(data);
        return data;
    }
}
